load("//bazel:skia_rules.bzl", "generate_cpp_files_for_headers", "skia_cc_library", "split_srcs_and_hdrs")

package(
    default_applicable_licenses = ["//:license"],
)

licenses(["notice"])

VK_FILES = [
    "VulkanExtensions.cpp",
    "VulkanInterface.cpp",
    "VulkanInterface.h",
    "VulkanMemory.cpp",
    "VulkanMemory.h",
    "VulkanUtilsPriv.cpp",
    "VulkanUtilsPriv.h",
    "VulkanMutableTextureStatePriv.h",
    "VulkanMutableTextureState.cpp",
]

split_srcs_and_hdrs(
    name = "_vk",
    files = VK_FILES,
)

generate_cpp_files_for_headers(
    name = "headers_to_compile",
    headers = [
        "VulkanMutableTextureStatePriv.h",
    ],
)

skia_cc_library(
    name = "vk",
    srcs = [
        ":_vk_srcs",
        "//include/private/gpu/vk:private_hdrs",
    ],
    hdrs = [
        ":_vk_hdrs",
        "//include/gpu/vk:shared_public_hdrs",
    ],
    features = ["layering_check"],
    implementation_deps = [
        "//include/third_party/vulkan",
    ],
    local_defines = ["SK_USE_INTERNAL_VULKAN_HEADERS"],
    visibility = [
        "//src/gpu/ganesh/vk:__pkg__",
        "//src/gpu/graphite/vk:__pkg__",
        "//src/gpu/vk/vulkanmemoryallocator:__pkg__",
    ],
    deps = [
        "//:core",
        "//src/base",
        "//src/gpu",
        "//src/sksl/codegen:spirv",
    ],
)
